package com.publiccms.entities.log;

//Generated 2015-6-25 11:28:56 by Hibernate Tools 4.3.1

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.springframework.format.annotation.DateTimeFormat;

import com.sanluan.common.source.entity.MyColumn;

/**
 * LogLogin generated by hbm2java
 */
@Entity
@Table(name = "log_login")
public class LogLogin implements java.io.Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer id;
	@MyColumn(title = "用户名", condition = true, like = true)
	private String name;
	@MyColumn(title = "用户", condition = true)
	private Integer userId;
	@MyColumn(title = "IP", condition = true, like = true)
	private String ip;
	@MyColumn(title = "登录结果", condition = true)
	private boolean result;
	@MyColumn(title = "登录日期", condition = true, order = true)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date createDate;
	@MyColumn(title = "错误密码")
	private String errorPassword;

	public LogLogin() {
	}

	public LogLogin(String name, String ip, boolean result, Date createDate) {
		this.name = name;
		this.ip = ip;
		this.result = result;
		this.createDate = createDate;
	}

	public LogLogin(String name, Integer userId, String ip, boolean result, Date createDate, String errorPassword) {
		this.name = name;
		this.userId = userId;
		this.ip = ip;
		this.result = result;
		this.createDate = createDate;
		this.errorPassword = errorPassword;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "name", nullable = false, length = 45)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "user_id")
	public Integer getUserId() {
		return this.userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	@Column(name = "ip", nullable = false, length = 20)
	public String getIp() {
		return this.ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	@Column(name = "result", nullable = false)
	public boolean isResult() {
		return this.result;
	}

	public void setResult(boolean result) {
		this.result = result;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_date", nullable = false, length = 19)
	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@Column(name = "error_password", length = 100)
	public String getErrorPassword() {
		return this.errorPassword;
	}

	public void setErrorPassword(String errorPassword) {
		this.errorPassword = errorPassword;
	}

}
